package com.qf.cm.controller;

import com.qf.cm.pojo.Subitem;
import com.qf.cm.service.SubitemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Description: 公用常量
 * @Data: 2022/9/7 21:09
 * @Pacakge: com.qf.cm.controller
 * @ClassName: SubitemController
 * @Author: fan
 */
@Controller
@RequestMapping("subitem")
public class SubitemController {
    @Autowired
    private SubitemService subitemService;
    @RequestMapping("findSubitemBySname")
    public ModelAndView findSubitemBySname(String sname){
        ModelAndView modelAndView = new ModelAndView();
        Subitem subitem = subitemService.findSubitemBySname(sname);
        modelAndView.setViewName("/pages/subitem/subitem");
        modelAndView.addObject("subitem",subitem);
        return modelAndView;
    }
    @RequestMapping("findSubitemBySuid")
    public ModelAndView findSubitemBySid(String suid){
        ModelAndView modelAndView = new ModelAndView();
        Subitem subitem = subitemService.findSubitemBySid(suid);
        modelAndView.setViewName("/pages/subitem/subitem");
        modelAndView.addObject("subitem",subitem);
        return modelAndView;
    }

}
